<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>
    <meta name="layout" content="main" />
    <fbg:resources locale="${Locale.getDefault()}" />
    <title>Testando conexão com facebook</title>

<script type="text/javascript">
	function facebookLogin() {
		FB.getLoginStatus(function(response) {
			if (response.session) {
				// logged in and connected user, someone you know
				window.location ="${createLink(controller:'evento', action:'list')}";
			}
		});
	}
</script>
    <script src="http://connect.facebook.net/en_US/all.js">

    </script>
<script>
	FB.init({appId: '117310565011877', cookie: true, xfbml: true, status: true});
</script>
  </head>
  <body>
    <fb:login-button perms="email,publish_stream" onlogin="facebookLogin();" size="large">
	<g:message code="auth.login.facebook"/>
</fb:login-button>
  <g:form method="post">
  <g:textArea name="message" rows="5" cols="40"/>
    <g:actionSubmit  action="publicar" value="${message(code: 'default.button.update.label', default: 'Publicar')}" />
  </g:form>
  </body>
</html>
